package com.huawei.gzq.domain;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class User {
    private int id;
    private String name;
    private int sex;
    private int age;
    private String email;

    @Override
    public String toString() {
        return "My name is " + name + ". <br>" +
                "I'm a " + age + " years old " + ((sex == 1) ? "boy" : "girl") + ".<br>" +
                "My email address is " + email + ".<br>";
    }

    public static User blankUser() {
        return User.builder().id(0).name("xxx").sex(0).email("xxx@xxx.com").build();
    }
}
